<#import "../macro/components.ftl" as components/>
<#include "../macro/layout_default.ftl"/>

<@body>

</@body>
<@head>
<link rel="stylesheet" href="/misc/app/css/lgs_logistics.css"/>
</@head>
<@layout_default>
<div class="box">
    <div class="box-header with-border">
        <form class="form-inline" action="/logistics" name="queryForm">
            <div class="input-group">
                <div class="input-group-addon">箱码</div>
                <input type="text" class="form-control" style="width: 180px" name="boxNo" value="${boxNo!}" placeholder="箱码"/>
            </div>

            <div class="input-group">
                <div class="input-group-addon">瓶码</div>
                <input type="text" class="form-control" style="width: 180px" name="bottleNo" value="${bottleNo!}" placeholder="瓶码"/>
            </div>
            <button type="submit" class="btn btn-warning"><i class="fa fa-search"></i> 查询</button>
        </form>
    </div>
    <div class="box-body">
        <table class="table table-striped table-hover">
            <tr>
                <th style="width: 40%">产品名称: ${resultMap.proName!} </th>
                <th>批次号：${resultMap.batchNo!}</th>
            </tr>
            <tr>
                <th>箱码：${resultMap.boxNo!} </th>
                <th>瓶码：
                    <#if (resultMap.bottleNoList?size > 0)>
                        <#list resultMap.bottleNoList as item>
                            ${item.pQrcodeId!}&nbsp;&nbsp; &nbsp; &nbsp;
                        </#list>
                    </#if>
                </th>
            </tr>
        </table>
        <form class="form-horizontal" >
            <#if (resultMap.list?size > 0)>
                <div>
                    <ul class="lgs_logistics">
                        <#list resultMap.list as item>
                            <#--<#if resultMap.scanTime?exists>-->
                                <#--<#if item.scanTime = resultMap.scanTime>-->
                                    <#--<li>-->
                                        <#--<p>${resultMap.custScan.scanTime?number_to_datetime}</p>-->
                                        <#--<p>${resultMap.custScan.custName!}&nbsp;&nbsp; &nbsp; &nbsp;进货扫码</p>-->
                                        <#--<p>网点编码:${resultMap.custScan.custCode!}</p>-->
                                        <#--<span class="before"></span><span class="after"></span>-->
                                    <#--</li>-->
                                <#--</#if>-->
                            <#--</#if>-->
                            <#if item.cust?exists>
                                <li>
                                    <p>${item.scanTime?number_to_datetime}</p>
                                    <p>${item.custName!}&nbsp;&nbsp; &nbsp; &nbsp;进货扫码</p>
                                    <p>网点编码:${item.custCode!}</p>
                                    <span class="before"></span><span class="after"></span>
                                </li>
                            <#else>
                                <li>
                                    <p>${item.scanTime?number_to_datetime}</p>
                                    <p>${item.scanDepotName!}&nbsp;&nbsp; &nbsp; &nbsp;${item.nodeName!}</p>
                                    <p>单号:${item.billsNo!}&nbsp;&nbsp; &nbsp; &nbsp;
                                        类型:<#if item.billsType?exists>
                                            <#if item.billsType == 1>自建</#if>
                                            <#if item.billsType == 2>erp抓取</#if>
                                            <#if item.billsType == 3>其它</#if>
                                        </#if>
                                    </p>
                                    <p>
                                        <#if item.nodeType?exists>
                                            <#if item.nodeType == 1>收货对象:${item.toDeot!}</#if>
                                            <#if item.nodeType == 2>发货对象:
                                                <#if item.billsType?exists>
                                                    <#if item.billsType == 1>${item.fromDepot!}<#else>未提供
                                                    </#if>
                                                </#if>
                                            </#if>
                                        </#if>
                                    </p>
                                    <span class="before"></span><span class="after"></span>
                                </li>
                            </#if>

                        </#list>

                    </ul>
                </div>
            <#elseif  resultMap.custScan?exists>
                <div>
                    <ul class="lgs_logistics">
                        <li>
                            <p>${resultMap.custScan.scanTime?number_to_datetime}</p>
                            <p>${resultMap.custScan.custName!}&nbsp;&nbsp; &nbsp; &nbsp;进货扫码</p>
                            <p>网点编码:${resultMap.custScan.custCode!}</p>
                            <span class="before"></span><span class="after"></span>
                        </li>

                    </ul>
                </div>
            </#if>
        </form>
    </div>
</div>
</@layout_default>